<?php
/**
 * 新闻详细页面
 */
class Detail extends CI_Controller {
    
    public function index() {
        $tid = $this->input->get('id',TRUE);
        
        if(!$tid) {
           show_404();
        }
        
        $site = parent::getSiteValue();
        
        $this->load->model('thread');
        $condition = array('tid'=>$tid);
        $data['detail'] = $this->thread->getThread($condition,0,1,TRUE);
        
        if(empty($data['detail'])) {
            show_404();
        }
        
        //增加文章点击数
        $this->thread->updateClick($tid);
        
        $this->load->view('/common/header');
        $this->load->view('/detail',$data);
        $this->load->view('/common/footer',$site);
    }
}